package com.yinpeng.app.web;

import com.yinpeng.app.domain.Note;
import com.yinpeng.app.repository.NoteRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/note")
public class NoteController {

    @Autowired
    private NoteRepository noteRepository;

    @RequestMapping(value = "/ls", method = RequestMethod.GET)
    public List<Note> ls(){
        return  noteRepository.findAll();
    }
}
